import request from '@/utils/request';


export async function query({...resetParams}) {
  return request(`/meters`,{
    method:'GET',
    params:{
      ...resetParams,
      order_direction:'desc'
    }
  });
}


export async function remove({id}) {
  return request(`/meters/${id}`, {
    method: 'DELETE',
  });
}
export async function queryPress({...resetParams}) {
  return request(`/hydrants`,{
    method:'GET',
    params:{
      ...resetParams,
      per_page:500,
      order_direction:'asc',
      order_column:'name'
    }
  });
}

export async function add(restParams) {
  return request(`/meters`, {
    method: 'POST',
    data: {
      ...restParams,
    },
  });
}
export async function addValue(restParams) {
  return request(`/mechanical_meter_data`, {
    method: 'POST',
    data: {
      communication_type:1,
      values:restParams,
    },
  });
}


export async function edit({id,...restParams}) {
  return request(`/meters/${id}`, {
    method: 'PUT',
    data: {
      ...restParams,
    },
  });
}

